﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GameSite.Models
{
    public class HomeViewModel
    {
        public const int ROW_NUM = 6;

        public HomeViewModel(GameA4Context context)
        {
            var gamenews = context.GameNews;
            var activities = context.Activities;

            Config = GlobalViewModel.ConfigModel;
            GameNews = gamenews.GetDispList().Take(ROW_NUM).ToList();
            SlideNews = gamenews.GetSlideList().Take(ROW_NUM).ToList();
            Activities = activities.GetDispList().Take(ROW_NUM).ToList();
        }

        public ConfigViewModel Config { get; private set; }

        public IEnumerable<GameNew> SlideNews { get; private set; }

        public IEnumerable<GameNew> GameNews { get; private set; }

        public IEnumerable<Activity> Activities { get; private set; }
    }
}